package com.gitee.cirnochat.group.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.gitee.cirnochat.group.model.entity.GroupApply;
import com.gitee.cirnochat.group.model.vo.req.GroupApplyAddRequest;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
* @author FlanChan
* @description 针对表【group_apply(群聊请求记录)】的数据库操作Service
* @createDate 2025-06-26 22:08:10
*/
public interface GroupApplyService extends IService<GroupApply> {

    // 发送加群申请
    void sendGroupApply(GroupApplyAddRequest req, Long fromId);

    // 管理员同意加群申请
    @Transactional(rollbackFor = Exception.class)
    void acceptGroupApply(Long applyId, Long adminId);

    // 拒绝加群申请
    void rejectGroupApply(Long applyId, Long adminId);

    // 申请人撤回加群申请
    void revokeGroupApply(Long applyId, Long fromId);

    // 查询某群的加群申请
    List<GroupApply> listGroupApplies(Long groupId);
}
